package top.wshape1.rpc.consumer.tolerant;

import lombok.extern.slf4j.Slf4j;
import top.wshape1.rpc.common.entity.ServiceMeta;

import java.util.function.Function;

/**
 * @author Wshape1
 * @version 1.0
 * @description 无视错误
 * @since 2024-02-16
 */

@Slf4j
public class FailsafeTolerantStrategy implements FaultTolerantStrategy {
    @Override
    public Object handle(Function<ServiceMeta, Object> invoker, ServiceMeta curServiceMeta, Exception error) {
        log.info("Failsafe. currentServiceMeta: {} ,error: {}", curServiceMeta, error.getMessage(), error);
        return null;
    }
}
